package com.gnerv.battle.boot.module.base.model.bo;

import com.gnerv.battle.boot.common.tools.DateTimeTools;
import com.gnerv.battle.boot.module.base.model.entity.Notice;
import lombok.Data;
import org.springframework.beans.BeanUtils;

/**
 * @author Gnerv LiGen
 */
@Data
public class NoticeBO {

    private String ukId;
    private String accountUkId;
    private String title;
    private String content;
    private String status;
    private Integer sort;

    public Notice toCreateNotice(){
        Notice notice = new Notice();
        BeanUtils.copyProperties(this, notice);
        notice.setGmtCreate(DateTimeTools.currentTimeMillis());
        notice.setGmtModified(DateTimeTools.currentTimeMillis());
        return notice;
    }

    public Notice toUpdateNotice(){
        Notice notice = new Notice();
        BeanUtils.copyProperties(this, notice);
        notice.setGmtModified(DateTimeTools.currentTimeMillis());
        return notice;
    }

}
